package org.example.demo11_factory;

// Client.java
public class Client {
    public static void main(String[] args) {
        try {
            Shape shape;

            shape = ShapeFactory.createShape("circle");
            shape.draw();
            shape.erase();

            shape = ShapeFactory.createShape("rectangle");
            shape.draw();
            shape.erase();

            shape = ShapeFactory.createShape("triangle");
            shape.draw();
            shape.erase();

            // Unsupported shape type will throw an exception
            shape = ShapeFactory.createShape("invalid");

        } catch (UnsupportedShapeException e) {
            e.printStackTrace();
        }
    }
}